{include file="common/_header"}
{include file="common/_header1"}

<body class="layui-anim layui-anim-up">
<div class="x-nav">
          <span class="layui-breadcrumb">
            <a href="">首页</a>
            <a href="">商铺管理</a>
            <a>
              <cite>商铺报表</cite></a>
          </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"
       href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i></a>
</div>

<div class="x-body">

    <!--        <xblock>-->
    <!--&lt;!&ndash;            <button class="layui-btn layui-btn-danger" onclick="delAll()"><i class="layui-icon"></i>批量删除</button>&ndash;&gt;-->
    <!--            <button class="layui-btn" onclick="x_admin_show('添加商铺','/suborg/boxesuborg?sbg_id=0',800,800)"><i class="layui-icon"></i>  添 加</button>-->
    <!--            &lt;!&ndash;            <span class="x-right" style="line-height:40px">共有数据：88 条</span>&ndash;&gt;-->
    <!--        </xblock>-->

    <div class="layui-row">
        <form class="layui-form layui-col-md12 x-so">

            {if $data.get['shop_id'] <= 0}
<!--            <div class="layui-unselect layui-form-select" style="display:inline-block;">-->
<!--                <select class="layui-select" name="shop_type">-->
<!--                    <option value="">请选择商铺类型</option>-->
<!--                    <option value="1" {if $data.get['shop_type'] == 1}selected{/if}>线上</option>-->
<!--                    <option value="2" {if $data.get['shop_type'] == 2}selected{/if}>线下</option>-->
<!--                    <option value="3" {if $data.get['shop_type'] == 3}selected{/if}>线上兼线下</option>-->
<!--                </select>-->
<!--            </div>-->
            <div class="layui-unselect layui-form-select paystate" style="display:inline-block;">
                <input type="text" name="shop_name"  placeholder="请输入商铺名称" value="{$data.get['shop_name']}" autocomplete="off" class="layui-input">
            </div>
            {/if}
            <div class="layui-input-inline">
                <input type="text" name="time" class="layui-input" id="test1" placeholder="请选择时间" style="min-width: 250px;" readonly value="{$data.get.time}">
            </div>


            <button class="layui-btn"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
        </form>
    </div>



    <table id="tables" class="layui-table">
        <thead>
        <tr>
            <th>商铺编号</th>
            <th>商铺名称</th>
            <th>店长名称</th>
<!--            <th>商铺类型</th>-->
            <th>地址</th>
            <th>订单总数</th>
            <th>订单总金额</th>
            <th>团餐总金额</th>
            <th>线下点餐总金额</th>
        </tr>
        </thead>
        <tbody>
        {volist name="data.data" id="vo"}
        <tr class="table_tr">
            <td>{$vo.shop_id}</td>
            <td>{$vo.shop_name}</td>
            <td>{$vo.shop_manager}</td>
<!--            <td>{if $vo.shop_type == 1}线上{elseif $vo.shop_type == 2}线下{else}线上兼线下{/if}</td>-->
            <td>{$vo.province} {$vo.city} {$vo.area} {$vo.address}</td>
            <td>{$vo.count}</td>
            <td>{$vo.money}</td>
            <td>{$vo.tc}</td>
            <td>{$vo.xxdc}</td>

        </tr>
        {/volist}
        </tbody>
    </table>
    <div class="page_all">
        {$page|raw}
    </div>
</div>
<script src="/static/admin/lib/layui/layui2.js" charset="utf-8"></script>
<script type="text/javascript">
    layui.use('laydate', function(){
        let laydate = layui.laydate;

        //常规用法
        laydate.render({
            elem: '#test1'
            ,type: 'datetime'
            ,format: 'yyyy-M-d H:m:s'
            , range: true
        });

        //国际版
        laydate.render({
            elem: '#test1-1'
            ,lang: 'en'
        });
    });
</script>
<script>

    // 搜索
    // Ajaxpage();
    // function Ajaxpage(curr) {
    //     var key = $('#keydown').val();
    //     var num = $('#num').val();
    //     $.getJSON('{:url("/admin/Repl/please")}', {
    //         page: curr || 1, key:key, key: num
    //     }, function (data) {
    //         console.log(data);
    //     })
    // }

    $(function () {
        // 表格选中行的同时选中单选框
        $("#tables tr:gt(0)").click(function () {
            $(this).find(":radio").prop("checked", true);
        });

    });

    //js放到table下，才能检测到tr数组
    var trs = document.getElementById("tables").getElementsByTagName("tr");
    $(function () {
        for (var i = 0; i < trs.length; i++) {
            trs[i].onmousedown = function () {
                mousedownclick(this);
            }
        }
    });

    function mousedownclick(obj) {
        for (var j = 0; j < trs.length; j++) {
            if (trs[j] == obj) {
                if (trs[0] != obj) {
                    trs[j].style.background = '#D0E9C6';
                    // 启用新增和编辑按钮
                    $("#edits").removeAttr("disabled");//启用按钮
                    $('#edits').removeClass('layui-disabled');
                }
            } else {
                trs[j].style.background = '';
            }
        }
    }
</script>
</body>

{include file="common/_bottom"}